import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login/Login.vue'
import Chat from '@/views/Chat/Chat.vue'
import Robot from '@/views/Chat/Robot.vue'
import Feedback from '@/views/Chat/Feedback.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/chat',
    name: 'chat',
    component: Chat,
    redirect: '/chat/robot',
    children: [
      { path: 'robot', name: 'robot', component: Robot },
      { path: 'feedback', name: 'feedback', component: Feedback }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
